<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="spring" uri="http://www.springframework.org/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="contentContainer" /></title>
</head>
<body>
    <h1><fmt:message key="contentContainer" /></h1>
    <c:url var="updateUrl" value="/domain/contentContainer/updateFile.action"/>
    <form:form action="${updateUrl}" id="contentContainerForm" modelAttribute="contentContainerForm" enctype="multipart/form-data">
        <form:errors cssClass="error"/>
        <table>
            <form:hidden path="contentContainer.inode"/>
            <tbody>
                <tr>
                    <th><fmt:message key="contentContainer_contentletInode" /> *</th>
                    <td>
						<span>
                        ${contentContainerForm.contentContainer.contentletInode} -- ${contentContainerForm.contentContainer.contentlet.title}
						</span><br/>
						<img src="${adminHttpUrl}${contentContainerForm.contentContainer.contentlet.fileAsset.path}" width="60" height="60" /><br/>
						<span>
							${contentContainerForm.contentContainer.contentlet.fileAsset.width} X ${contentContainerForm.contentContainer.contentlet.fileAsset.height}
							&nbsp;${contentContainerForm.contentContainer.contentlet.fileAsset.fileSize}
						</span>
                        <form:errors cssClass="error" path="contentContainer.contentletInode"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="contentContainer_folderInode" /> *</th>
                    <td>
                        ${contentContainerForm.contentContainer.folderInode} -- ${contentContainerForm.contentContainer.folder.title}
                        <form:errors cssClass="error" path="contentContainer.folderInode"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="contentContainer_containerInode" /> *</th>
                    <td>
                        ${contentContainerForm.contentContainer.containerInode} --  ${contentContainerForm.contentContainer.container.title}
                        <form:errors cssClass="error" path="contentContainer.containerInode"/>
                    </td>
                </tr>

                <tr>
                    <th><fmt:message key="contentContainer_fileAssetInode" /></th>
                    <td>
						<img src="${adminHttpUrl}${contentContainerForm.contentContainer.fileAsset.path}" width="60" height="60" /><br/>
						<span>
							${contentContainerForm.contentContainer.fileAsset.width} X ${contentContainerForm.contentContainer.fileAsset.height}
							&nbsp;${contentContainerForm.contentContainer.fileAsset.fileSize}
						</span>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="contentContainer_newFile" /></th>
                    <td>
						<input type="file" name="file" />
						<br/>
						<span>${contentContainerForm.contentContainer.container.notes}</span>
						<form:errors cssClass="error" path="file"/>
                    </td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2">
                        <div class="buttons">
                            <button id="updateButton" type="submit"><fmt:message key="label.form.submit"/></button>
                            <script type="text/javascript">
                                Spring.addDecoration(new Spring.ValidateAllDecoration({
                                    elementId:'updateButton',
                                    event:'onclick'
                                }));
                            </script>
                            <c:url var="showUrl" value="/domain/contentContainer/show.action">
                                <c:param name="contentContainer.inode" value="${contentContainerForm.contentContainer.inode}"/>
                            </c:url>
                            <a href="${showUrl}"><span><fmt:message key="label.link.show"/></span></a>
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </form:form>
</body>
